<?php
class RM_Deposit_Row extends RM_Row {
    /**
     * Return value of the deposit for reservation
     *
     * @param float $reservationPrice - total reservation price that need to be calculated deposit for
     * @return void
     */
    public function calculate($reservationPrice){
        if ($this->type == "percentage"){
            $price = ($reservationPrice / 100) * $this->value;
        } else {
            $price = $this->value;
        }
        return RM_Environment::getInstance()->roundPrice($price);
    }
}
 
